{extends file="layout/layout.tpl"}

{block name=otherLibraries}
<script type="text/javascript" src="/javascripts/jquery/jquery.qtip.min.js"></script>
<script type="text/javascript" src="/javascripts/jquery/jquery.ui.progressbar.min.js"></script>
<script type="text/javascript" src="/javascripts/member/index.js"></script>
<link type="text/css" rel="stylesheet" href="/css/member/index.css"/>
{/block}

{block name=otherComponents}
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
  <tr>	
    <td style="padding: 5px 5px 10px 5px;"><img src="/images/logo.png" alt="Logo" /></td>
    {include file="profile/change_password.tpl"}
  </tr>
  <tr>
    <td colspan="2" style="padding: 10px 5px 0px 5px;">
    	{include file="menu/member.tpl"}
	<div id="tab_main">
	
		<!-- this wrapper is used for overlapping green background color of tab_main when slide effect is working -->
		<div id="tab_content_wrapper">
			<div id="tab_content">
				<!-- New member button will be preprended here -->
				
				<div class="table_border" id="memberBorder">
					<table id="listMemberTable" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th>ID</th>
								<th>Họ tên</th>
								<th>Email</th>
								<th>Admin</th>
								<th>Trạng thái</th>
								<th>Chức năng</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
			
			<div id="tab_content_page">
				<div style="padding: 0 0 5px 0;">
					<div>Ban quyền cho <span id="memberNameSpan" style="font-weight: bold"></span></div>
					<div id="privReport" style="margin: 0.5em 0 0.5em 0;" style="display: none;"></div>
					<div>
						Module
						<select id="moduleSelect" style="width: 12em;">
							<option value="news">Tin tức</option>
							<option value="page">Web tĩnh</option>							
							<option value="banner">Banner</option>							
							<option value="account">Tài khoản trực tuyến</option>
						</select>
						<span><input id="submitButton" type="button" value="Lưu thay đổi"/></span>
						<span><input id="backButton" type="button" value="Trở lại"/></span>
					</div>
				</div>
				
				<!-- Privilege table on news and banner module -->
				<div class="table_border" id="privBorder">
					<form id="privForm" method="post">
					<table id="privTable" cellpadding="0" cellspacing="0" >
						<thead>
							<th>Quyền</th>
							<th>Thay đổi</th>
						</thead>
						<tbody>
							<tr class="privCheckBoxWrapper">
								<td style="text-align: right;">Liệt kê</td>
								<td><input type="checkbox" id="selectPrivCheckBox" name="selectPrivCheckBox"/></td>
							</tr>
							<tr class="privCheckBoxWrapper" id="insertPrivCheckBoxWrapper">
								<td style="text-align: right;">Thêm</td>
								<td><input type="checkbox" id="insertPrivCheckBox" name="insertPrivCheckBox"/></td>
							</tr>
							<tr class="privCheckBoxWrapper">
								<td style="text-align: right;">Sửa</td>
								<td><input type="checkbox" id="updatePrivCheckBox" name="updatePrivCheckBox"/></td>
							</tr>
							<tr class="privCheckBoxWrapper">
								<td style="text-align: right;">Xóa</td>
								<td>
									<input type="checkbox" id="deletePrivCheckBox" name="deletePrivCheckBox"/>
									<input type="hidden" id="privMemberID" name="privMemberID"/>
								</td>						
							</tr>						
						</tbody>
					</table>
					</form>
				</div>
			
				
				<!-- Privilege table on page module -->
				<div class="table_border" id="pageBorder">
					<form id="pageForm">
					<table id="pageTable" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th style="width: 6em;">ID</th>
								<th>Tên</th>
								<th style="width: 20em;">Quyền</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
					</form>
				</div>
			</div>
		</div>
	</div>
	</td>
  </tr>
  <tr>
  	<td colspan="2" style="padding: 0 5px;" class="footer">&copy; BMSC giữ bản quyền {$smarty.now|date_format: "%Y"}</td>
  </tr>
</table>

<div id="newMemberDialog" title="Thêm nhân viên">
<form id="newMemberForm" method="post">
<table width="100%">
  
    <tr id="newMemberErrorRow">
      
      <td colspan="2" id="newMemberErrorMessage" class="error"></td>
    </tr>
    
    <tr>
    	<td align="right">Họ tên <span class="required">*</span></td>
    	<td><input type="text" id="newMemberFullName" name="newMemberFullName"></td>
    </tr>
    
    <tr>
		<td align="right">Email <span class="required">*</span></td>
		<td><input type="text" id="newMemberEmail" name="newMemberEmail"/></td>
    </tr>
    
    <tr>
		<td align="right">Mật khẩu <span class="required">*</span></td>
		<td><input type="password" id="newMemberPassword" name="newMemberPassword"/></td>
    </tr>
    
    <tr>
		<td align="right">Xác nhận mật khẩu <span class="required">*</span></td>
		<td><input type="password" id="newMemberPasswordConfirm" name="newMemberPasswordConfirm"/></td>
    </tr>
    
    <tr>
      <td align="right">Là Admin</td>
      <td>
      	<input type="checkbox" id="newMemberIsAdmin" name="newMemberIsAdmin" value="1"/>
      </td>
    </tr>
    
    <tr>
      <td align="right">Kích hoạt</td>
      <td>
      	<input type="checkbox" id="newMemberIsActive" name="newMemberIsActive" value="1"/>
      </td>
    </tr>
</table>
</form>
</div>


<div id="editMemberDialog" title="Sửa nhân viên">
<form id="editMemberForm" method="post">
<table width="100%">
  
    <tr id="editMemberErrorRow">
      
      <td colspan="2" id="editMemberErrorMessage" class="error"></td>
    </tr>
    
    <tr>
    	<td style="text-align: right; width: 9em;">Họ tên <span class="required">*</span></td>
    	<td><input type="text" id="editMemberFullName" name="editMemberFullName"></td>
    </tr>
    
    <tr>
		<td style="text-align: right">Email <span class="required">*</span></td>
		<td><input type="text" id="editMemberEmail" name="editMemberEmail"/></td>
    </tr>
	
	<tr>
		<td style="text-align: right">Đổi mật khẩu </td>
		<td>
		<input type="checkbox" id="editMemberPasswordBool" name="editMemberPasswordBool" />
		</td>
	</tr>
	
	<tr id="editMemberCurrentPasswordWrapper" class="editMemberChangePassword">
		<td style="text-align: right">Mật khẩu hiện hành </td>
		<td>
		<input type="password" id="editMemberCurrentPassword" name="editMemberCurrentPassword" />
		</td>
	</tr>
	
	<tr class="editMemberChangePassword" id="editMemberNewPasswordWrapper">
		<td style="text-align: right">Mật khẩu mới </td>
		<td>
		<input type="password" id="editMemberNewPassword" name="editMemberNewPassword" />
		</td>
	</tr>
	
	<tr class="editMemberChangePassword"  id="editMemberNewPasswordConfirmWrapper">
		<td align="right">Xác nhận mật khẩu </td>
		<td>
		<input type="password" id="editMemberNewPasswordConfirm" name="editMemberNewPasswordConfirm" />
		</td>
	</tr>
    
    <tr id="editMemberIsAdminWrapper">
      <td align="right">Là Admin </td>
      <td>
      	<input type="checkbox" id="editMemberIsAdmin" name="editMemberIsAdmin" />
      </td>
    </tr>
    
    <tr id="editMemberIsActiveWrapper">
      <td align="right">Kích hoạt </td>
      <td>
      	<input type="checkbox" id="editMemberIsActive" name="editMemberIsActive" />
        <input type="hidden" id="editMemberID" name="editMemberID" />
      </td>
    </tr>

</table>
</form>
</div>

<div id="removeMemberDialog" title="Xóa nhân viên">
	<form id="removeMemberForm" method="post">
    <div><img src="/images/icon/delete_32.png" align="left" /> Bạn có chắc chắn xóa nhân viên có ID: <span id="removeShowMemberID" style="font-weight: bold;"></span>?</div>
    <input type="hidden" id="removeMemberID" name="removeMemberID" />
  </form>
</div>




<div id="loadingDialog">
<div style="text-align: center; padding: 1em;">Đang xử lý...</div>
</div>
{/block}